		<HTML>
		<HEAD>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<meta name="description" content="Flash MX 2004 ActionScript2.0 Library: VelocityVerlet - Wright Internet Solutions">
		<meta name="keywords" content="calculus,solvers,RK45,MultiStep,Velocity,Verlet,Flash,MX,2004,ActionScript,ActionScript2.0,AS2.0 Library,AS2,AS2 Library,Wright Internet Solutions,Wright,classes,documentation,methods,functions,interfaces,JavaScript,Java">
		<TITLE>WIS AS2 Library : com.wis.math.calc.solvers.VelocityVerlet Documentation</TITLE>

		<STYLE><!--
		HR.small{height:1px; width:100%; background:#E7BFA3; border: 0px;}
		HR.big{height:4px; width:100%; background:#E7BFA3; border: 0px;}
		A:hover{text-decoration: underline}
		A{text-decoration: none; color: #993333}
		code{font-family: monospace; font-size: 12px; color: #666666;}
		.methodAttributesTitle{font-size: 12px; font-weight: bold; color: #7B779C}
		.ToC{font-size: 12px; font-weight: bold; color: #993333}
		.methodTitle{font-size: 14px; font-weight: bold; color: #993333}
		.groupTitle{font-size: 18px; font-weight: bold; color: #993333}
		.sectionTitle{font-size: 22px; font-weight: bold; color: #993333}
		.majorTitle{font-size: 32px; font-weight: bold; color: #993333; padding-bottom:100px;}
		.methodsDiv{margin-left:40px;}
		.footer{font-size: 11px; color: #666666;}
		body{font-family: arial,sans-serif; font-size: 12px;}
		//--></STYLE>

		</HEAD>
		<BODY bgColor='#ffffcc'>
		<P class='majorTitle'>com.wis.math.calc.solvers.VelocityVerlet Documentation</P>

        <P><B>Author:</B> <a href='mailto:wisolutions2002@shaw.ca?subject=wisASLibrary  VelocityVerlet Class'>Richard Wright</a><BR>
		<B>Last Modified:</B> 01/12/05 01:08:34<HR class='big'>

		<P class='sectionTitle'>Summary</P>
		<P class='ToC'>com.wis.math.calc.solvers.VelocityVerlet class:</P>
		<div class='methodsDiv'><a href='#classinfo'>- description</a></div>
<P class='ToC'>com.wis.math.calc.solvers.VelocityVerlet Properties:</P><div class='methodsDiv'>
<a href='#$stepSize'>- $stepSize</a><br>
<a href='#$numEqn'>- $numEqn</a><br>
<a href='#$rate1'>- $rate1</a><br>
<a href='#$rate2'>- $rate2</a><br>
<a href='#$ode'>- $ode</a><br>
</div><br>
<P class='ToC'>com.wis.math.calc.solvers.VelocityVerlet Methods:</P><div class='methodsDiv'>
<a href='# initialize'>-  initialize</a><br>
<a href='# step'>-  step</a><br>
<a href='# setStepSize'>-  setStepSize</a><br>
<a href='# getStepSize'>-  getStepSize</a><br>
<a href='# setTolerance'>-  setTolerance</a><br>
<a href='# getTolerance'>-  getTolerance</a><br>
</div><br>

		<HR class='big'>
		<P class='sectionTitle'><A name='classinfo'></A>com.wis.math.calc.solvers.VelocityVerlet <I>class</I></P>
		<P> <span class='methodTitle'>version:</span> 1.7</P>
		<P class="methodTitle">description:</P>
		<P>VelocityVerlet:  A velocity Verlet method IODE solver. The velocity
 Verlet algorithm is a self-starting equivalent of the Verlet
 algorithm. It assumes a constant acceleration to estimate the
 final position and an average accleration to estimate the final
 velocity. The position is first updated, the force is calcualted
 at the new position, and then the velocity is updated.

 <pre> x(n+1) = x(n) + v(n)dt + a(n)dtdt/2
 a_est=F(x(n+1),v(n),t)/m
 v(n+1) = v(n) + (a(n)+a_est)dt/2</pre>

 CAUTION! The IODE interface produces an inefficient implementation
 of the velocity Verlet algorithm since the force is evaluated twice.
 The velocity Verlet algorithm is usually coded directly into the
 model so that the force need only be evaluated once.
 <p>
 CAUTION! This implementation assumes that the state vector has
 2N + 1 variables. These variables alternate between position and
 velocity with the last variable being time. That is, the state
 vector is ordered as follows:

 <pre> x1, d x1/dt, x2, d x2/dt, x3, d x3/dt ..... xN, d xN/dt, t</pre>
 </P>
		<P class="methodTitle">usage:</P> <pre>var inst:VelocityVerlet = new VelocityVerlet(_ode);</pre>

<P> <span class='methodTitle'>parameters:</span>
				<ul>
<li>      _ode  (IODE)  -- the system of differential equations.</li>
</ul>

			<HR class='small'>
			<P class='groupTitle'><A name='properties'></A>com.wis.math.calc.solvers.VelocityVerlet Properties:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name='$stepSize'></A><u> $stepSize</u></P>
				<P> (Number)  -- parameter increment such as delta time.</P>

				<P class='methodTitle'><A name='$numEqn'></A><u> $numEqn</u></P>
				<P> (Number)  -- number of equations.</P>

				<P class='methodTitle'><A name='$rate1'></A><u> $rate1</u></P>
				<P> (Array)  -- array that stores the 1st rate.</P>

				<P class='methodTitle'><A name='$rate2'></A><u> $rate2</u></P>
				<P> (Array)  -- array that stores the 2nd rate.</P>

				<P class='methodTitle'><A name='$ode'></A><u> $ode</u></P>
				<P> (IODE)  -- object that computes rate.</P>
</div>

			<HR class='small'>
			<P class='groupTitle'><A name='methods'></A>com.wis.math.calc.solvers.VelocityVerlet Methods:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name=' initialize'></A><u>  initialize</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Initializes the IODE solver. Two temporary rate arrays are
     allocated. The number of differential equations is determined
     by invoking getState().length on the IODE.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>inst.initialize(_stepSize);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  _stepSize  (Number) -- step integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Void)
    </P>

				<P class='methodTitle'><A name=' step'></A><u>  step</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Steps (advances) the differential equations by the stepSize.
     The IODESolver invokes the IODE's getRate method to obtain the
     initial state of the system. The IODESolver then advances the
     solution and copies the new state into the state array at the
     end of the solution step.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>inst.step();</pre>
     </P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns step size.
    </P>

				<P class='methodTitle'><A name=' setStepSize'></A><u>  setStepSize</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Sets the step size. The step size remains fixed in this
     algorithm.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>inst.setStepSize(_stepSize);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  _stepSize  (Number) -- step integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Void)
    </P>

				<P class='methodTitle'><A name=' getStepSize'></A><u>  getStepSize</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Gets the step size. The stepsize is constant in this algorithm.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>inst.getStepSize();</pre>
     </P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns step size.
    </P>

				<P class='methodTitle'><A name=' setTolerance'></A><u>  setTolerance</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Abstract interface method.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>not used.</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  _tol  (Number) -- .</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Void)
    </P>

				<P class='methodTitle'><A name=' getTolerance'></A><u>  getTolerance</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Abstract interface method.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>not used.</pre>
     </P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)
    </P>
</div>

			<BR>
			<BR>
			<HR class='big'>
			<span class="footer">generated with <A href='http://blog.klaustrofobik.org/' target='_blank'>AS2docGenerator beta 0.5.3</A></span>
			</BODY>
			</HTML>

